package com.xiang.design.factory;


import com.xiang.design.factory.Impl.SaveLogToFile;
import com.xiang.design.factory.Impl.SaveLogToLocal;
import com.xiang.design.factory.Impl.SaveLogToRemote;

/**
 * 日志工厂
 *
 * @author xiangtianlei@gogpay.cn
 * @date 2022-09-28
 */
public class LogFactory {

    /**
     * 获取日志保存的地方
     *
     * @param savePlace 保存地方
     * @see String
     * @see Log
     */
    public Log getLog(String savePlace) {
        if ("File".equalsIgnoreCase(savePlace)) {
            return new SaveLogToFile();
        } else if ("Local".equalsIgnoreCase(savePlace)) {
            return new SaveLogToLocal();
        } else if ("Remote".equalsIgnoreCase(savePlace)) {
            return new SaveLogToRemote();
        }
        return null;
    }
}
